<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-form-item label="系统用户ID" prop="userId">
        <el-input
          v-model="queryParams.userId"
          placeholder="请输入系统用户ID"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="真实姓名" prop="realName">
        <el-input
          v-model="queryParams.realName"
          placeholder="请输入真实姓名"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="身份证号" prop="idCard">
        <el-input
          v-model="queryParams.idCard"
          placeholder="请输入身份证号"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="会员类型" prop="memberType">
        <el-select v-model="queryParams.memberType" placeholder="请选择会员类型" clearable>
          <el-option
            v-for="dict in dict.type.rental_member_type"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="会员等级" prop="memberLevel">
        <el-select v-model="queryParams.memberLevel" placeholder="请选择会员等级" clearable>
          <el-option
            v-for="dict in dict.type.rental_member_level"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item label="实名认证" prop="isVerified">
        <el-select v-model="queryParams.isVerified" placeholder="请选择认证状态" clearable>
          <el-option
            v-for="dict in dict.type.sys_normal_disable"
            :key="dict.value"
            :label="dict.label"
            :value="dict.value"
          />
        </el-select>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
      </el-form-item>
    </el-form>

    <el-row :gutter="10" class="mb8">
      <el-col :span="1.5">
        <el-button
          type="primary"
          plain
          icon="el-icon-plus"
          size="mini"
          @click="handleAdd"
          v-hasPermi="['system:member:add']"
        >新增</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="success"
          plain
          icon="el-icon-edit"
          size="mini"
          :disabled="single"
          @click="handleUpdate"
          v-hasPermi="['system:member:edit']"
        >修改</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="danger"
          plain
          icon="el-icon-delete"
          size="mini"
          :disabled="multiple"
          @click="handleDelete"
          v-hasPermi="['system:member:remove']"
        >删除</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button
          type="warning"
          plain
          icon="el-icon-download"
          size="mini"
          @click="handleExport"
          v-hasPermi="['system:member:export']"
        >导出</el-button>
      </el-col>
      <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
    </el-row>

    <el-table 
      v-loading="loading" 
      :data="infoList" 
      @selection-change="handleSelectionChange"
      stripe
      border
      highlight-current-row
      class="common-table"
    >
      <el-table-column type="selection" width="55" align="center" />
      <el-table-column label="会员ID" align="center" prop="memberId" width="80" />
      <el-table-column label="用户ID" align="center" prop="userId" width="80" />
      <el-table-column label="真实姓名" align="center" prop="realName" width="100" />
      <el-table-column label="身份证号" align="center" prop="idCard" width="150" />
      <el-table-column label="会员类型" align="center" prop="memberType" width="100">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.rental_member_type" :value="scope.row.memberType"/>
        </template>
      </el-table-column>
      <el-table-column label="会员等级" align="center" prop="memberLevel" width="80">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.rental_member_level" :value="scope.row.memberLevel"/>
        </template>
      </el-table-column>
      <el-table-column label="信用分" align="center" prop="creditScore" width="80" />
      <el-table-column label="押金余额" align="center" prop="depositBalance" width="90" />
      <el-table-column label="钱包余额" align="center" prop="walletBalance" width="90" />
      <el-table-column label="订单数" align="center" prop="totalOrders" width="80" />
      <el-table-column label="消费金额" align="center" prop="totalAmount" width="100" />
      <el-table-column label="实名认证" align="center" prop="isVerified" width="80">
        <template slot-scope="scope">
          <dict-tag :options="dict.type.sys_normal_disable" :value="scope.row.isVerified"/>
        </template>
      </el-table-column>
      <el-table-column label="认证时间" align="center" prop="verifiedTime" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.verifiedTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="创建时间" align="center" prop="createdTime" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createdTime, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="240">
        <template slot-scope="scope">
          <div class="operation-buttons">
            <el-button
              size="mini"
              type="primary"
              icon="el-icon-edit"
              @click="handleUpdate(scope.row)"
              v-hasPermi="['system:member:edit']"
              title="修改会员信息"
              class="operation-btn"
            >修改</el-button>
            <el-button
              size="mini"
              type="success"
              icon="el-icon-location"
              @click="handleViewAddresses(scope.row)"
              v-hasPermi="['system:addresses:list']"
              title="查看会员地址"
              class="operation-btn"
            >地址</el-button>
            <el-button
              size="mini"
              type="danger"
              icon="el-icon-delete"
              @click="handleDelete(scope.row)"
              v-hasPermi="['system:member:remove']"
              title="删除会员"
              class="operation-btn"
            >删除</el-button>
          </div>
        </template>
      </el-table-column>
    </el-table>
    
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 添加或修改会员信息对话框 -->
    <el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="90px">
        <el-row :gutter="20">
          <!-- 基本信息 -->
          <el-col :span="12">
            <el-form-item label="用户ID" prop="userId">
              <el-input-number v-model="form.userId" :min="1" placeholder="请输入用户ID" style="width: 100%" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="真实姓名" prop="realName">
              <el-input v-model="form.realName" placeholder="请输入真实姓名" maxlength="50" />
            </el-form-item>
          </el-col>
          <el-col :span="24">
            <el-form-item label="身份证号" prop="idCard">
              <el-input v-model="form.idCard" placeholder="请输入18位身份证号" maxlength="18" />
            </el-form-item>
          </el-col>
          
          <!-- 会员信息 -->
          <el-col :span="12">
            <el-form-item label="会员类型" prop="memberType">
              <el-select v-model="form.memberType" placeholder="请选择会员类型" style="width: 100%">
                <el-option
                  v-for="dict in dict.type.rental_member_type"
                  :key="dict.value"
                  :label="dict.label"
                  :value="parseInt(dict.value)"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="会员等级" prop="memberLevel">
              <el-select v-model="form.memberLevel" placeholder="请选择会员等级" style="width: 100%">
                <el-option
                  v-for="dict in dict.type.rental_member_level"
                  :key="dict.value"
                  :label="dict.label"
                  :value="parseInt(dict.value)"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          
          <!-- 财务信息 -->
          <el-col :span="12">
            <el-form-item label="信用分" prop="creditScore">
              <el-input-number v-model="form.creditScore" :min="0" :max="1000" placeholder="0-1000" style="width: 100%" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="押金余额" prop="depositBalance">
              <el-input-number v-model="form.depositBalance" :min="0" :precision="2" placeholder="0.00" style="width: 100%" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="钱包余额" prop="walletBalance">
              <el-input-number v-model="form.walletBalance" :min="0" :precision="2" placeholder="0.00" style="width: 100%" />
            </el-form-item>
          </el-col>
          
          <!-- 认证信息 -->
          <el-col :span="12">
            <el-form-item label="实名认证" prop="isVerified">
              <el-select v-model="form.isVerified" placeholder="请选择认证状态" style="width: 100%">
                <el-option
                  v-for="dict in dict.type.sys_normal_disable"
                  :key="dict.value"
                  :label="dict.label"
                  :value="parseInt(dict.value)"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12" v-if="form.isVerified === 1">
            <el-form-item label="认证时间" prop="verifiedTime">
              <el-date-picker 
                v-model="form.verifiedTime"
                type="date"
                value-format="yyyy-MM-dd"
                placeholder="请选择认证时间"
                style="width: 100%"
                clearable>
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>

    <!-- 会员地址管理对话框 -->
    <el-dialog :title="addressDialogTitle" :visible.sync="addressDialogOpen" width="1200px" append-to-body>
      <div class="address-management">
        <!-- 地址列表操作按钮 -->
        <el-row :gutter="10" class="mb8">
          <el-col :span="1.5">
            <el-button
              type="primary"
              plain
              icon="el-icon-plus"
              size="mini"
              @click="handleAddAddress"
              v-hasPermi="['system:addresses:add']"
            >新增地址</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="success"
              plain
              icon="el-icon-edit"
              size="mini"
              :disabled="singleAddress"
              @click="handleUpdateAddress"
              v-hasPermi="['system:addresses:edit']"
            >修改地址</el-button>
          </el-col>
          <el-col :span="1.5">
            <el-button
              type="danger"
              plain
              icon="el-icon-delete"
              size="mini"
              :disabled="multipleAddress"
              @click="handleDeleteAddress"
              v-hasPermi="['system:addresses:remove']"
            >删除地址</el-button>
          </el-col>
        </el-row>

        <!-- 地址列表表格 -->
        <el-table 
          v-loading="addressLoading" 
          :data="addressList" 
          @selection-change="handleAddressSelectionChange"
          stripe
          border
          highlight-current-row
          max-height="400"
        >
          <el-table-column type="selection" width="55" align="center" />
          <el-table-column label="联系人" align="center" prop="contactName" width="100" />
          <el-table-column label="联系电话" align="center" prop="contactPhone" width="120" />
          <el-table-column label="省份" align="center" prop="province" width="80" />
          <el-table-column label="城市" align="center" prop="city" width="80" />
          <el-table-column label="区县" align="center" prop="district" width="80" />
          <el-table-column label="详细地址" align="center" prop="detailAddress" show-overflow-tooltip />
          <el-table-column label="默认地址" align="center" prop="isDefault" width="80">
            <template slot-scope="scope">
              <el-tag :type="scope.row.isDefault === 1 ? 'success' : 'info'" size="mini">
                {{ scope.row.isDefault === 1 ? '是' : '否' }}
              </el-tag>
            </template>
          </el-table-column>
          <el-table-column label="创建时间" align="center" prop="createdTime" width="100">
            <template slot-scope="scope">
              <span>{{ parseTime(scope.row.createdTime, '{y}-{m}-{d}') }}</span>
            </template>
          </el-table-column>
          <el-table-column label="操作" align="center" width="150">
            <template slot-scope="scope">
              <el-button
                size="mini"
                type="primary"
                icon="el-icon-edit"
                @click="handleUpdateAddress(scope.row)"
                v-hasPermi="['system:addresses:edit']"
              >修改</el-button>
              <el-button
                size="mini"
                type="danger"
                icon="el-icon-delete"
                @click="handleDeleteAddress(scope.row)"
                v-hasPermi="['system:addresses:remove']"
              >删除</el-button>
            </template>
          </el-table-column>
        </el-table>
      </div>
    </el-dialog>

    <!-- 添加或修改地址对话框 -->
    <el-dialog :title="addressFormTitle" :visible.sync="addressFormOpen" width="600px" append-to-body>
      <el-form ref="addressForm" :model="addressForm" :rules="addressRules" label-width="90px">
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="联系人" prop="contactName">
              <el-input v-model="addressForm.contactName" placeholder="请输入联系人姓名" />
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="联系电话" prop="contactPhone">
              <el-input v-model="addressForm.contactPhone" placeholder="请输入联系电话" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="20">
          <el-col :span="8">
            <el-form-item label="省份" prop="province">
              <el-input v-model="addressForm.province" placeholder="请输入省份" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="城市" prop="city">
              <el-input v-model="addressForm.city" placeholder="请输入城市" />
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="区县" prop="district">
              <el-input v-model="addressForm.district" placeholder="请输入区县" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-form-item label="详细地址" prop="detailAddress">
          <el-input 
            v-model="addressForm.detailAddress" 
            type="textarea" 
            :rows="3" 
            placeholder="请输入详细地址" 
          />
        </el-form-item>
        <el-form-item label="默认地址" prop="isDefault">
          <el-radio-group v-model="addressForm.isDefault">
            <el-radio :label="1">是</el-radio>
            <el-radio :label="0">否</el-radio>
          </el-radio-group>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitAddressForm">确 定</el-button>
        <el-button @click="cancelAddress">取 消</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
import { listInfo, getInfo, delInfo, addInfo, updateInfo } from "@/api/system/memberinfo";
import { listAddresses, getAddresses, delAddresses, addAddresses, updateAddresses } from "@/api/system/addresses";

export default {
  name: "Info",
  dicts: ['rental_member_type', 'rental_member_level', 'sys_normal_disable'],
  data() {
    return {
      // 遮罩层
      loading: true,
      // 选中数组
      ids: [],
      // 非单个禁用
      single: true,
      // 非多个禁用
      multiple: true,
      // 显示搜索条件
      showSearch: true,
      // 总条数
      total: 0,
      // 会员信息表格数据
      infoList: [],
      // 弹出层标题
      title: "",
      // 是否显示弹出层
      open: false,
      // 查询参数
      queryParams: {
        pageNum: 1,
        pageSize: 10,
        userId: null,
        realName: null,
        idCard: null,
        memberType: null,
        memberLevel: null,
        isVerified: null
      },
      // 表单参数
      form: {},
      // 表单校验
      rules: {
        userId: [
          { required: true, message: "用户ID不能为空", trigger: "blur" },
          { type: 'number', message: "用户ID必须为数字", trigger: "blur" }
        ],
        realName: [
          { required: true, message: "真实姓名不能为空", trigger: "blur" },
          { min: 2, max: 50, message: "真实姓名长度在2到50个字符", trigger: "blur" }
        ],
        idCard: [
          { required: true, message: "身份证号不能为空", trigger: "blur" },
          { pattern: /^[1-9]\d{5}(18|19|20)\d{2}((0[1-9])|(1[0-2]))(([0-2][1-9])|10|20|30|31)\d{3}[0-9Xx]$/, message: "请输入正确的身份证号", trigger: "blur" }
        ],
        memberType: [
          { required: true, message: "会员类型不能为空", trigger: "change" }
        ],
        memberLevel: [
          { required: true, message: "会员等级不能为空", trigger: "change" }
        ],
        creditScore: [
          { type: 'number', min: 0, max: 1000, message: "信用分范围为0-1000", trigger: "blur" }
        ],
        depositBalance: [
          { type: 'number', min: 0, message: "押金余额不能为负数", trigger: "blur" }
        ],
        walletBalance: [
          { type: 'number', min: 0, message: "钱包余额不能为负数", trigger: "blur" }
        ],
        isVerified: [
          { required: true, message: "实名认证状态不能为空", trigger: "change" }
        ]
      },
      // 地址管理相关
      currentMember: {},
      addressDialogOpen: false,
      addressDialogTitle: "",
      addressLoading: false,
      addressList: [],
      addressIds: [],
      singleAddress: true,
      multipleAddress: true,
      // 地址表单
      addressFormOpen: false,
      addressFormTitle: "",
      addressForm: {},
      addressRules: {
        contactName: [
          { required: true, message: "联系人姓名不能为空", trigger: "blur" },
          { max: 50, message: "联系人姓名长度不能超过50个字符", trigger: "blur" }
        ],
        contactPhone: [
          { required: true, message: "联系电话不能为空", trigger: "blur" },
          { pattern: /^1[3-9]\d{9}$/, message: "请输入正确的手机号码", trigger: "blur" }
        ],
        province: [
          { required: true, message: "省份不能为空", trigger: "blur" }
        ],
        city: [
          { required: true, message: "城市不能为空", trigger: "blur" }
        ],
        district: [
          { required: true, message: "区县不能为空", trigger: "blur" }
        ],
        detailAddress: [
          { required: true, message: "详细地址不能为空", trigger: "blur" },
          { max: 200, message: "详细地址长度不能超过200个字符", trigger: "blur" }
        ],
        isDefault: [
          { required: true, message: "请选择是否为默认地址", trigger: "change" }
        ]
      }
    };
  },
  created() {
    this.getList();
  },
  methods: {
    /** 查询会员信息列表 */
    getList() {
      this.loading = true;
      listInfo(this.queryParams).then(response => {
        this.infoList = response.rows;
        this.total = response.total;
        this.loading = false;
      });
    },
    // 取消按钮
    cancel() {
      this.open = false;
      this.reset();
    },
    // 表单重置
    reset() {
      this.form = {
        memberId: null,
        userId: null,
        realName: null,
        idCard: null,
        memberType: null,
        memberLevel: null,
        creditScore: null,
        depositBalance: null,
        walletBalance: null,
        totalOrders: null,
        totalAmount: null,
        isVerified: null,
        verifiedTime: null,
        createdTime: null,
        updatedTime: null
      };
      this.resetForm("form");
    },
    /** 搜索按钮操作 */
    handleQuery() {
      this.queryParams.pageNum = 1;
      this.getList();
    },
    /** 重置按钮操作 */
    resetQuery() {
      this.resetForm("queryForm");
      this.handleQuery();
    },
    // 多选框选中数据
    handleSelectionChange(selection) {
      this.ids = selection.map(item => item.memberId)
      this.single = selection.length!==1
      this.multiple = !selection.length
    },
    /** 新增按钮操作 */
    handleAdd() {
      this.reset();
      this.open = true;
      this.title = "添加会员信息";
    },
    /** 修改按钮操作 */
    handleUpdate(row) {
      this.reset();
      const memberId = row.memberId || this.ids
      getInfo(memberId).then(response => {
        this.form = response.data;
        this.open = true;
        this.title = "修改会员信息";
      });
    },
    /** 提交按钮 */
    submitForm() {
      this.$refs["form"].validate(valid => {
        if (valid) {
          if (this.form.memberId != null) {
            updateInfo(this.form).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.open = false;
              this.getList();
            });
          } else {
            addInfo(this.form).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.open = false;
              this.getList();
            });
          }
        }
      });
    },
    /** 删除按钮操作 */
    handleDelete(row) {
      const memberIds = row.memberId || this.ids;
      this.$modal.confirm('是否确认删除会员信息编号为"' + memberIds + '"的数据项？').then(function() {
        return delInfo(memberIds);
      }).then(() => {
        this.getList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    /** 导出按钮操作 */
    handleExport() {
      this.download('system/member/info/export', {
        ...this.queryParams
      }, `memberinfo_${new Date().getTime()}.xlsx`)
    },
    
    // ==================== 地址管理相关方法 ====================
    /** 查看会员地址列表 */
    handleViewAddresses(row) {
      this.currentMember = row;
      this.addressDialogTitle = `${row.realName || '会员ID:' + row.memberId} 的地址管理`;
      this.addressDialogOpen = true;
      this.getAddressList();
    },
    
    /** 查询地址列表 */
    getAddressList() {
      this.addressLoading = true;
      const queryParams = {
        memberId: this.currentMember.memberId
      };
      listAddresses(queryParams).then(response => {
        this.addressList = response.rows || [];
        this.addressLoading = false;
      }).catch(() => {
        this.addressLoading = false;
      });
    },
    
    /** 地址多选框选中数据 */
    handleAddressSelectionChange(selection) {
      this.addressIds = selection.map(item => item.addressId);
      this.singleAddress = selection.length !== 1;
      this.multipleAddress = !selection.length;
    },
    
    /** 新增地址按钮操作 */
    handleAddAddress() {
      this.resetAddressForm();
      this.addressFormOpen = true;
      this.addressFormTitle = "添加地址";
    },
    
    /** 修改地址按钮操作 */
    handleUpdateAddress(row) {
      this.resetAddressForm();
      const addressId = row ? row.addressId : this.addressIds[0];
      getAddresses(addressId).then(response => {
        this.addressForm = response.data;
        this.addressFormOpen = true;
        this.addressFormTitle = "修改地址";
      });
    },
    
    /** 提交地址表单 */
    submitAddressForm() {
      this.$refs["addressForm"].validate(valid => {
        if (valid) {
          // 设置会员ID
          this.addressForm.memberId = this.currentMember.memberId;
          
          if (this.addressForm.addressId != null) {
            updateAddresses(this.addressForm).then(response => {
              this.$modal.msgSuccess("修改成功");
              this.addressFormOpen = false;
              this.getAddressList();
            });
          } else {
            addAddresses(this.addressForm).then(response => {
              this.$modal.msgSuccess("新增成功");
              this.addressFormOpen = false;
              this.getAddressList();
            });
          }
        }
      });
    },
    
    /** 删除地址按钮操作 */
    handleDeleteAddress(row) {
      const addressIds = row ? [row.addressId] : this.addressIds;
      const addressNames = row ? [row.contactName] : this.addressList.filter(item => this.addressIds.includes(item.addressId)).map(item => item.contactName);
      
      this.$modal.confirm(`是否确认删除联系人为"${addressNames.join(', ')}"的地址信息？`).then(function() {
        return delAddresses(addressIds.join(','));
      }).then(() => {
        this.getAddressList();
        this.$modal.msgSuccess("删除成功");
      }).catch(() => {});
    },
    
    /** 取消地址表单 */
    cancelAddress() {
      this.addressFormOpen = false;
      this.resetAddressForm();
    },
    
    /** 重置地址表单 */
    resetAddressForm() {
      this.addressForm = {
        addressId: null,
        memberId: null,
        contactName: null,
        contactPhone: null,
        province: null,
        city: null,
        district: null,
        detailAddress: null,
        isDefault: 0
      };
      if (this.$refs.addressForm) {
        this.$refs.addressForm.resetFields();
      }
    }
  }
};
</script>

<style scoped>
/* 操作按钮样式优化 */
.operation-buttons {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.operation-btn {
  margin: 2px 0;
  border-radius: 4px;
  font-weight: 500;
  transition: all 0.3s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.operation-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* 地址管理弹窗样式优化 */
.address-management {
  padding: 10px;
}

.address-management .el-table {
  border-radius: 6px;
  overflow: hidden;
}

.address-management .el-table th {
  background-color: #f8f9fa;
  color: #495057;
  font-weight: 600;
}

.address-management .el-table td {
  padding: 12px 0;
}

/* 地址表格操作按钮样式 */
.address-management .el-button {
  margin: 0 2px;
  border-radius: 4px;
  transition: all 0.3s ease;
}

.address-management .el-button:hover {
  transform: translateY(-1px);
}

/* 表格行悬停效果 */
.el-table .el-table__row:hover {
  background-color: #f8f9fa;
}

/* 按钮组间距调整 */
.mb8 .el-col {
  margin-bottom: 8px;
}

/* 对话框标题样式 */
.el-dialog__title {
  font-weight: 600;
  color: #303133;
}

/* 表单标签样式 */
.el-form-item__label {
  font-weight: 500;
  color: #606266;
}

/* 标签样式优化 */
.el-tag {
  border-radius: 12px;
  font-weight: 500;
}
</style>
